<template>
  <div class="left--top pat">
    <div class="left--title3" v-show="canShowInfo">
      <span>患者信息</span>
    </div>
    <ul class="info--box3" v-show="canShowInfo">
      <li class="info--item2">
        <span class="item--sub">患者ID:</span>
        <span class="item--word" :title="curDocRecord.sNo">{{
          curDocRecord.sNo
        }}</span>
      </li>
      <li class="info--item2">
        <span class="item--sub">姓名:</span>
        <span class="item--word" :title="curDocRecord.name">{{
          curDocRecord.name
        }}</span>
      </li>
      <li class="info--item2">
        <span class="item--sub">性别:</span>
        <span class="item--word">{{
          curDocRecord.sex === 1 ? "男" : "女"
        }}</span>
      </li>
      <li class="info--item2">
        <span class="item--sub">年龄:</span>
        <span class="item--word">{{ curDocRecord.year }}</span>
      </li>
      <li class="info--item2">
        <span class="item--sub">检查部位:</span>
        <span class="item--word" :title="curDocRecord.pos">{{
          curDocRecord.pos
        }}</span>
      </li>
      <li class="info--item2">
        <span class="item--sub">检查状态:</span>
        <span class="item--word">{{ stateInfo[curDocRecord.state] }}</span>
      </li>
    </ul>
  </div>
</template>

<script>
import { stateInfo } from "@/utils";
export default {
  name: "PatInfoComp",
  props: ["curDocRecord", "canShowInfo"],
  data() {
    return {
      stateInfo: stateInfo,
    };
  },
};
</script>
<style lang="less" scoped>
.left--title3 {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: start;
  height: 47px;
  padding: 0 15px;
  box-sizing: border-box;
  span {
    color: rgba(255, 255, 255, 1);
    font-size: 20px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  &.nopadding {
    padding: 0;
  }
}
.info--box3 {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  .info--item2 {
    width: 100%;
    height: 30px;
    line-height: 30px;
    .item--word {
      display: inline-block;
      width: 185px;
      color: #fff;
      font-size: 16px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .item--sub {
      display: inline-block;
      width: 83px;
      color: rgba(255, 255, 255, 0.45);
      font-size: 16px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      text-align: right;
      margin-right: 5px;
    }
  }
}
</style>
